# config.py
import os

class Config:
    SECRET_KEY = os.getenv('SECRET_KEY', 'default_secret_key')
    SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL', 'mysql+pymysql://root:root@localhost/dco_webhook_db')
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # SMTP 配置
    SMTP_SERVER = os.getenv('SMTP_SERVER', 'smtp.qq.com')
    SMTP_PORT = int(os.getenv('SMTP_PORT', 587))
    SMTP_USERNAME = os.getenv('SMTP_USERNAME', '2742645790@qq.com')
    SMTP_PASSWORD = os.getenv('SMTP_PASSWORD', 'vfostijcuyyndhai')
    EMAIL_RECIPIENT = os.getenv('EMAIL_RECIPIENT', '2742645790@qq.com')
    EMAIL_SUBJECT = os.getenv('EMAIL_SUBJECT', None)
    EMAIL_BODY_TEMPLATE = os.getenv('EMAIL_BODY_TEMPLATE', None)

    # Webhook 配置
    WEBHOOK_SECRET = os.getenv('WEBHOOK_SECRET', '')

    # 日志配置
    LOG_FILE = os.getenv('LOG_FILE', 'logs/app.log')
